package com.capsulode.excel.exception;

/**
 * Exception occurs when reading from a cell.
 */
public class ConsumeCellFailedException extends Exception {
    private final int row;
    private final int column;

    public ConsumeCellFailedException(int row, int column, String message) {
        super(String.format("%d行 %d列 %s", row + 1, column + 1, message));
        this.row = row + 1;
        this.column = column + 1;
    }

    public ConsumeCellFailedException(int row, int column, Throwable ex) {
        super(String.format("%d行 %d列 导入出错", row + 1, column + 1), ex);
        this.row = row + 1;
        this.column = column + 1;
    }


    public ConsumeCellFailedException(int row, int column, String message, Throwable ex) {
        super(String.format("%d行 %d列 %s", row + 1, column + 1, message), ex);
        this.row = row + 1;
        this.column = column + 1;
    }

    public int getRow() {
        return row;
    }

    public int getColumn() {
        return column;
    }
}
